package com.ctwom.algorithm.questions.Blinkedlist;

public class Node {
    private Integer value;
    public Node next;
    Node(int value, Node next){
        this.value = value;
        this.next = next;
    }
    public Integer getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public static void forEachNodes(Node head){
        while(head != null && head.getValue() != null){
            System.out.println(head.getValue() + "---->");
            if(head.next!= null){
                head = head.next;
            }else{
                break;
            }
        }
        System.out.println("null");
    }
}
